package com.songcha.sakura.ui.activity.test

import android.os.Bundle
import android.view.View
import com.songcha.library_base.base.BaseActivity
import com.songcha.sakura.R
import com.songcha.sakura.databinding.ActivityTestBinding
import com.songcha.sakura.mvvm.home.cate.HomeCateFragment


class TestActivity : BaseActivity() {
    private lateinit var binding:ActivityTestBinding

    //var list:MutableList<ComicListBean.ComicBean> = mutableListOf()
    //var mAdapter:HomeComicAdapter<ItemHomeComicBinding>?=null

    override fun getRootView() : View? {
        binding = ActivityTestBinding.inflate(layoutInflater)
        return binding.root
    }

 /*   override fun getLayoutId(): Int {
        return R.layout.activity_test
    }*/

    override fun initView(savedInstanceState: Bundle?) {
        super.initView(savedInstanceState)

 /*       val books=Recommend.RecommendBooks()
        books._id="111"
        books.title="111"
        books.path=externalCacheDir!!.absolutePath+"/111.txt"
        books.isFromSD=true


        // 拷贝到缓存目录
        FileUtils.fileChannelCopy(
            File(books.path),
            File(FileUtils.getChapterPath(books._id, 1))
        )
        // 加入书架
        if (CollectionsManager.getInstance().add(books)) {

        }

        ReadActivity.startActivity(
            this,
            books,
            true,
        )*/

        val bundle=Bundle()
        bundle.putInt("index",3)
        val frag= HomeCateFragment()
        frag.arguments=bundle

        val trans=supportFragmentManager.beginTransaction()
        trans.replace(R.id.frag,frag)
        trans.commit()




       /* val vp=binding.vp
        vp.adapter= HomeCateAdapter2(supportFragmentManager, arrayListOf("格斗","热血","恋爱"))
        vp.offscreenPageLimit=1
        binding.ctl.setViewPager(vp)*/



    }


    override fun isNeedShowLoad(): Boolean {
        return true
    }


}